import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/portal/user/login',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'get',
  })
}

 export function getInfo() {
   return request({
     url: '/portal/user/',
     method: 'get'
   })
 }

 export function updatePassword(oldPassword, newPassword) {
    let data = new FormData();
    data.append('oldPassword', oldPassword);
    data.append('newPassword', newPassword);
    return request({
      url: '/portal/user/resetPwd',
      method: 'put',
      data: data
    })
 }